package 数组练习题;

import java.util.Scanner;

//用一个数组，保存12个月的英语单词，从键盘输入1-12，显示对应的单词。
public class Demo5 {
    public static void main(String[] args) {
        String[] monthNames = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "Novembe r", "Decembe"};
        Scanner scanner=new Scanner(System.in);
        System.out.print("请输入月份值:");
        int month=scanner.nextInt();
        if (month<1 || month>12){
            System.out.println("输入有误");
        }else {
            System.out.println("月份"+month+"是"+monthNames[month-1]);
        }
    }
}

